﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace LanguagePolish.Controls
{
    /// <summary>
    /// Логика взаимодействия для MonthCalendarControl.xaml
    /// </summary>
    public partial class MonthCalendarControl : UserControl
    {
        private MonthCalendarViewModel vm;

        public bool EnableMenu { set { calendar.EnableMenu = value; } }

        public event EventHandler SwitchMode;

        public ILessonsProvider LessonsProvider 
        { 
            get { return vm.LessonsProvider; }
            set { vm.LessonsProvider = value; }
        }

        public MonthGrid Grid { get { return calendar; } }
        
        public void RefreshGrid()
        {
            vm.ReloadLessons();
        }

        public MonthCalendarControl()
        {
            InitializeComponent();
            vm = new MonthCalendarViewModel();
            DataContext = vm;
        }

        private void SwitchMode_Click(object sender, RoutedEventArgs e)
        {
            if (SwitchMode != null)
                SwitchMode(this, EventArgs.Empty);
        }

    }
}
